package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Supplier;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SupplierDao {
    @Insert("insert into supplier(supplierId,supplierName, supplierAddress, cardNo, cardName, bankName,subBanName,linkMan,phone, phone1, phone2, mark, updateTime) " +
            "values(#{supplierId},#{supplierName},#{supplierAddress},#{cardNo},#{cardName},#{bankName},#{subBanName},#{linkMan},#{phone},#{phone1},#{phone2},#{mark},#{updateTime})")
    int insert(Supplier house);

    @Select("select * from supplier")
    List<Supplier> query();
    @Select("select * from supplier where supplierId=#{supplierId}")
    Supplier queryById(String supplierId);
    @Select("select t1.*,t2.sonMerNo from supplier t1 LEFT join merchant t2 on t1.supplierId=t2.belongId")
    List<Supplier> queryForRoutingRule();
}
